home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 26.zip
/
BS1 part 26
/
Aztec C v5.2a disk 1.adf
/
read.me
< prev
next >
Wrap
Text File
|
1991-10-28
|
49KB
|
1,255 lines
Aztec C for the Amiga
Release notes
Version 5.2a
11/01/91
This release document describes version 5.2a of Aztec C for the
Amiga. It's organized into the following sections:
1. Installation instructions, which describes how to install the
Aztec C files from the distribution disks onto your disks;
2. Disk contents, which describes what's on the distribution disks;
3. New features, which describes what's changed in going from
version 5.0d/e to v5.2a;
4. Additional documentation, which describes features that have been
added after the manual was last printed and before the v5.2
release.
1. Installation
Aztec C v5.2a may be installed on either a dual-floppy drive or a
hard drive system. Single-floppy machines are not supported. To
install your package, from the CLI prompt type:
execute df0:install
This will start up an installation script, which will allow you to
choose between hard disk and dual-floppy installation.
1.1 Hard Disk Installation
If you choose hard disk installation, the install script will call
up the program 'AztecInstall'. This program displays a screen that
lets you customize the installation to suit your needs. As you make
your selections, keep track of the numbers on the bottom of the
screen: one displays the amount of storage required for the
installation, and the other displays the amount of storage available
on the selected drive.
Once you've made your selections, press the "Begin Installation"
gadget to continue with the installation; or press the "Close Window"
gadget in the top left-hand corner to terminate the installation.
After you click on "Begin Installation", insert the distribution
disks in df0: when prompted by the program.
When the files are all installed to the hard disk, the program will
return to the main screen. You can then click on the "Close Window"
gadget stop the program. The installation script will then resume and
complete the installation.
After the installation program is complete, you may then change
directories to your main Aztec directory. From there, you should
type:
execute Aztec.sh
This shell file will then initialize your system for use with Aztec
C, which should be done each time you reboot the machine (for this
page 1
Aztec C/Amiga, v5.2a 11/1/91
reason, you may wish to place the contents of the Aztec.sh file
directly in your 'Startup-Sequence' file). Your system will then be
installed, and you'll be ready to use Aztec C!
1.1.1 Choices during hard disk installation
The choices on the installation program's screen are organized into
the following areas:
- "Destination Directories" choices, which let you select the
directories in which files will be placed on your hard disk;
- "Copy ..." choices, which let you select the files that will be
installed;
- "Library options" choices, which let you select the attributes of
the installed libraries (i.e. memory model, int size, and math
type).
The following paragraphs describe these choices.
1.1.1.1 Choices in the 'Destination directories' screen area
1.1.1.1.1 The 'Device' buttons
The up- and down-arrow Device buttons are used to identify the
device (dh0:, work:, etc.) to which the installation program will copy
the Aztec files. As you click on these buttons, the names of the
available devices are displayed next to the device name.
1.1.1.1.2 The 'Root directory' text box
The "Root" text box identifies your root Aztec directory. The
installation program will create subdirectories of beneath this main
directory, and place Aztec files in these subdirectories. For
example, there will be subdirectories for executable programs, include
files, libraries, and so on.
The installation program will also create a script file, named
Aztec.sh, in the main Aztec directory. This file is described below.
The name of the root Aztec directory defaults to 'Aztec'.
1.1.1.1.3 The 'Programs directory' text box
The "Programs" text box identifies the directory into which the
installation program will place all executable Aztec programs. This
directory must be a subdirectory of the root Aztec directory. The name
of this subdirectory defaults to 'bin'.
1.1.1.1.4 The 'Include directory' text box
The "Includes" text box identifies the directory into which the
installation program will place all C include files. Some include
files will be placed in this directory, and some in subdirectories of
it. This directory must be a subdirectory of the root Aztec directory.
The name of this subdirectory defaults to 'include'.
page 2
Aztec C/Amiga, v5.2a 11/1/91
1.1.1.1.5 The 'Libraries directory' text box
The "Libraries" text box identifies the directory into which the
installation program will place all object module libraries. This
directory must be a subdirectory of the root Aztec directory. The name
of this subdirectory defaults to 'lib'.
Several subdirectories of this directory may be created, depending
on what you've chosen to install:
- Object module libraries are placed in the 'libs' subdirectory;
- Amiga FD's are placed in the 'fd' subdirectory;
- Library source is placed in other subdirectories.
1.1.1.2 Choices in the 'Copy...' screen area
The Copy... area of the screen contains check boxes that you check
to select items that you want to install. The following paragraphs
describe these check boxes.
1.1.1.2.1 The 'Programs' check box
If this box is checked, the installation program will install all
executable programs.
1.1.1.2.2 The 'C Includes' check box
If this box is checked, the installation program will install all C
include files.
1.1.1.2.3 The 'C Libs' check box
If this box is checked, the installation program will install the
non-floating point Aztec object module libraries that have the
attributes that you specify in the "Library options" screen area.
1.1.1.2.4 The 'Math libs' check box
If this box is checked, the installation program will install the
floating point Aztec object module libraries that have the attributes
that you specify in the "Library options" screen area.
1.1.1.2.5 The 'Lib source' check box
If this box is checked and if you've purchased the source to the
Aztec library routines, the installation program will install this
source.
1.1.1.2.6 The 'Examples' check box
If this box is checked, the installation program will install the
following source code:
- Example programs source, to subdirectories of the 'examples'
subdirectory of the root Aztec directory;
- Source for a sample resident library, to the 'res_lib'
subdirectory of the root Aztec directory;
- Source for the Aztec startup modules, to the 'startups'
subdirectory of the root Aztec directory.
page 3
Aztec C/Amiga, v5.2a 11/1/91
1.1.1.2.7 The 'ARP files' check box
If this box is checked, the installation program will install files
related to the arp.library on the 'arp' subdirectory of the root Aztec
directory.
1.1.1.2.8 The 'Amiga asm includes' check box
If this box is checked, the installation program will install
assembly language include files from Commodore-Amiga on the 'inc-asm'
subdirectory of the root Aztec directory.
1.1.1.2.9 The 'Amiga FD files' check box
If this box is checked, the installation program will install FD
files from Commodore-Amiga on the 'fd' subdirectory of the Aztec
library directory.
1.1.1.2.10 The 'Amiga libraries' check box
If this box is checked, the installation program will install object
module libraries from Commodore-Amiga, such as amiga.lib, in the
'libs' subdirectory of the Aztec library directory.
1.1.1.3 Choices in the 'Library Options' screen area
The 'Library options' section of the installation program's screen
allows you to select the attributes of the libraries that you want
installed. The selectable attributes are:
- Large code and large data memory model;
- Small code and small data memory model;
- 16-bit ints;
- 32-bit ints;
- Manx IEEE floating point;
- Amiga FFP floating point;
- Amiga IEEE floating point;
- 68881 floating point.
These features are described in detail in the Aztec C Reference
Manual.
1.2 Floppy disk installation
The two-drive floppy disk installation is handled jointly by the
'install' script and the program 'AztecInstall'. Two blank disks are
required for this installation. The installation script will
automatically prepare these two disks, so you don't have to format
them before beginning the installation. However, please insure that
nothing of importance is contained on either of these disks, as all
information on them will be lost during the installation process.
The floppy installation script will first prompt you whether or not
your second floppy drive is designated as 'df1:'. If you own an Amiga
1000 or Amiga 500 system with an external floppy drive, you should
answer 'yes' to this question. If you own an Amiga 2000 or 2500 with
one internal and one external drive, than the answer to this question
should be 'no'. This is because the external drive designation on 2000
and 2500 systems is 'df2:' instead of the usual 'df1:'. If your 2000
page 4
Aztec C/Amiga, v5.2a 11/1/91
or 2500 has 2 internal floppies, then you should answer 'yes', as the
second internal drive is considered 'df1:'.
The script will then copy the first Aztec distribution disk to your
first blank floppy, and prepare it for normal booting.
The script will then prompt you for the second blank disk. When you
insert the disk, the script will format the disk, giving it the name
'Az2:'.
After formatting the second disk, the install script will then
invoke the 'AztecInstall' program, passing it a special option, -f,
which tells it that this is an installation to a floppy disk.
AztecInstall will allow you to choose which libraries you wish to
install on your disks. By looking at the "space needed" and "space
available" items, make sure you don't choose more libraries than will
fit on the Az2 diskette. When you have chosen your libraries, click
'Begin Installation'. The program will then prompt you for the Aztec
distribution disks, starting with disk 2, which should be placed in
your first floppy drive (df0:).
When installation is complete, you should reboot your system with
the new disk 1 in your first floppy drive, and the second disk in the
second drive. After the system boots, you are ready to go!
1.3 Restarting the installation program
If you want, you can install the Aztec components in stages by
rerunning the AztecInstall program that's on the first distribution
disk. For example, during the initial installation, you might install
just the programs, include files, and libraries. Later, you could
install the example files by restarting AztecInstall and specifying
that you just want to install the example files.
1.4 Bypassing the installation program
Most of the files on the distribution disks are in standard lharc or
zoo archive format. So if you want, you can bypass the installation
program altogether and dearchive the archive files that are on the
distribution disks using the lharc and zoo programs that are provided
with Aztec C. These archive programs are installed in the Aztec root
directory's 'bin' subdirectory; these programs, and documentation on
how to use them, are also on distribution disk 2.
One thing to note if you're doing a manual installation: if you're
installing the C include files, you must install the Commodore-Amiga
include files that are in 204inc_h.lzh on disk 4 before installing the
Aztec include files that are in incl52.lzh on disk 4. That's because
incl52.lzh may provide alternate versions of some Commodore-Amiga
include files.
1.5 Creating libraries from source
Once you've dearchived the library source, you can build libraries
by cd'ing into the lib subdirectory of the root Aztec directory and
invoking the 'make' program, passing to it a code that identifies what
you want to make. the codes are:
page 5
Aztec C/Amiga, v5.2a 11/1/91
Code Library
all All libraries
c All C libraries
m All Manx IEEE math libraries
ma All Amiga IEEE math libraries
mf All Amiga FFP math libraries
m8 All 68881 math libraries
s All S (screen) libraries
css c16.lib (16-bit ints, small code&data)
cls c.lib (32-bit ints, small code&data0
csl cl16.lib (16-bit ints, large code&data0
cll cl.lib (32-bit ints, large code&data)
mss m16.lib
mls m.lib
msl ml16.lib
mll ml.lib
mass ma16.lib
mals ma.lib
masl mal16.lib
mall mal.lib
mfss mf16.lib
mfls mf.lib
mfsl mfl16.lib
mfll mfl.lib
m8ss m816.lib
m8ls m8.lib
m8sl m8l16.lib
m8ll m8l.lib
In addition, you can invoke make with the following codes to delete
selected object modules:
Code Object modules to delete
all_clean All object modules (but not the libraries)
c_clean All c library object modules
m_clean All Manx IEEE object modules
ma_clean All Amiga IEEE object modules
mf_clean All Amiga FFP object modules
m8_clean All 68881 object modules
s_clean All s library object modules
In order to get around a problem with the Aztec MAKE command when
running on Amiga DOS 2.0, a problem that occurs when building the
libraries, we have included the Amiga DOS 1.3 CD command file in the
bin subdirectory of the root Aztec directory. When a version of MAKE
is available that cures this problem, you can delete the CD command
file from the bin directory. The problem is this: when MAKE encounters
a CD command in the library makefile, it tries to execute a CD command
file; this was correct for AmigaDOS 1.3, but not for AmigaDOS 2.0,
since the code for this command is built into the AmigaDOS 2.0 shell.
page 6
Aztec C/Amiga, v5.2a 11/1/91
2. Contents of distribution disks
The following paragraphs describe the files that are on the Aztec
distribution disks.
2.1 Disk 1 contents
Disk 1 is bootable, containing standard AmigaDOS 1.3 files. The only
Aztec files it contains are the 'include' directory. This directory
contains versiqon 5.2 of the the Aztec include files, version 1.3 of
the Commodore-Amiga include files, and a functions.h file that
contains prototypes for the Commodore-Amiga v1.3 functions. These
include files are only used by floppy-based installations.
As described below, for hard disk-based installations, the Amiga
v2.0 include files are always used, even when developing programs that
only run on v1.3 of the Amiga OS. The reason why the v2.0 Amiga
include files weren't used for a floppy-based installation is that
they require much more disk space than the v2.0 include files.
2.2 Disk 2 contents
File Contents
as52.lzh as: the assembler
changes.as: log of changes to 'as'
cc52.lzh cc, the compiler
changes.cc: log of changes to 'cc'
ln52.lzh ln: the linker
changes.ln: log of changes to 'ln'
examples.lzh Source to example programs
prog52.lzh All other programs
changes.tools: log of changes
reslib52.lzh Source for resident library example
start52.lzh Source for startup routines
lharc lharc program
lharc.changes New features of lharc
lharc.doc Documentation on lharc
zoo zoo program
zoo.doc Documentation on zoo
In addition, developer versions of Aztec C contain the following
file:
dev52.lzh Developer-only programs: make, grep, diff, sdb,
and sdbf
2.3 Disk 3 contents
File Contents
arp#? ARP files
lib16_52.lzh The following libraries and object modules that
use small code&data and 16-bit ints: c16.lib,
m16.lib, and detach.oss (detach object module);
changes.lib: Changes to library routines.
lib52.lzh The following libraries and object modules that
use small code&data and 32-bit ints: c.lib, m.lib,
and detach.ols (detach object module);
changes.lib: Changes to library routines.
lib16l52.lzh The following libraries and object modules that
use large code&data and 16-bit ints: c16.lib,
page 7
Aztec C/Amiga, v5.2a 11/1/91
m16.lib, and detach.osl (detach object module);
changes.lib: Changes to library routines.
libl52.lzh The following libraries and object modules that
use large code&data and 32-bit ints: cl.lib,
ml.lib, and detach.oll (detach object module);
changes.lib: Changes to library routines.
m8_52.lzh 68881 math libraries
ma_52.lzh Amiga IEEE math libraries
mf_52.lzh Amiga FFP math libraries
s_52.lzh Screen libraries
2.4 Disk 4 contents
204fd.lzh v2.04 FD files from Commodore-Amiga
204inc_h.lzh v2.04 C include files from Commodore-Amiga
204inc_i.lzh v2.04 assembler include files from Commodore-Amiga
204lib.lzh v2.04 object libraries from Commodore-Amiga
incl52.lzh Aztec C include files
2.5 Disk 5 contents
ami_ffp.lzh Source to Amiga FFP math routines
ami_ieee.lzh Source to Amiga IEEE math routines
amisup.lzh Source to Amiga.lib-compatible routines
glue20.lzh Source to glue routines
inp.lzh Library generation support files, which go in the
lib/inp directory
libsrc52.lzh Library makefile, which go in the lib directory
m881.lzh Source to 68881 math routines
misc.lzh Source to files that go in the lib/misc directory
mx_ieee.lzh Source to Manx IEEE math routines
scr.lzh Source to screen library routines
stdio.lzh Source to routines that go in lib/stdio
stdlib.lzh Source to routines that go in lib/stdlib
string.lzh Source to routines that go in lib/string
sysio.lzh Source to routines that go in lib/sysio
time.lzh Source to routines that go in lib/time
3. New features
This section describes functional changes that have been made since
the v5.0d release.. A set of "changes" files are also provided that
contain a complete list of all changes, bug fixes as well as
functional changes, that have been made since v5.0d; for example,
bin/changes.cc describes compiler changes, bin/changes.describes
assembler changes, include/changes.inc describes include file changes,
and lib/changes.lib describes library changes.
The Additional Documentation section that follows this section
describes other features of v5.2 that aren't described in the manual.
For the most part, these are features that were introduced to earlier
versions of Aztec C, versions that came out since the manual was last
printed.
page 8
Aztec C/Amiga, v5.2a 11/1/91
3.1 Compiler changes
3.1.1 #pragmas can define a function's return register
Pragmas for "registerized" functions, such as the amicall pragma,
can now define the register in which the function returns its value.
The register name is specified just before the function name. If a
return register isn't specified, it defaults to d0.
For example, the following amicall pragma defines a function named
myfunc that returns its value in a0:
#pragma amicall (mybase, 0x38, a0 myfunc(d0, d1))
3.1.2 Change to format of precompiled header file
The format of the precompiled header file has been changed. Thus you
must recreate your precompiled header files before using v5.2 of Aztec
C.
3.1.3 Can't make registerized call to functions that use A4 or A5
The compiler no longer allows registerized calls to functions that
are passed arguments in register A4 or A5, since these registers are
used for other purposes (A4 is the small model support register and A5
is the frame pointer). Such functions will be accessed via "glue"
routines that are in the c libraries (c.lib, etc).
The mapfd program that generates amicall pragmas from the Commodore
fd's has also been changed to support this.
3.1.4 New compiler option: -mp
A new option, -mp has been added to the compiler. This option
prevents the compiler from "padding" structures that only contain
chars or arrays of chars.
This option is provided for SAS compatibility, and it also may be
occasionally useful in its own right.
3.1.5 Keywords supported with #if statements
The compiler now supports keywords within #if statements, except
when the -pa option has been used to enable the "strict ANSI" mode.
This allows things such as "#if sizeof(int)==2".
3.1.6 Restricting access to data in code segments
When the -MM option is used to force data into the code segment, the
compiler will now treat such data as "const" and report an error when
an attempt is made to assign a value to such data.
3.1.7 New compiler option: -wc
A new option, -wc, has been added to the compiler. It disables
"Invalid ptr/ptr conversion" error messages when the two pointers are
of type (char *) and (unsigned char *).
page 9
Aztec C/Amiga, v5.2a 11/1/91
3.1.8 Preserving register A6
The compiler now automatically preserves register A6 on function
entry and exit, whether or not the -r6 option is used.
3.2 Assembler changes
3.2.1 Default width for "dc" directive
When used without a size extension, the "dc" directive defaults to
"dc.w".
3.3 Changes to other programs
3.3.1 Changes to the mapfd program
The new -4 and -5 options cause mapfd to generate pragmas for
functions that are passed arguments in A4 or A5. By default, mapfd
will not generate pragmas for such functions.
3.4 Library changes
3.4.1 Changes to setlocale()
The setlocale() function was changed so that its second argument can
be NULL to fetch the current locale.
3.4.2 Changes to glue routines
Changes have been made to the glue routines that are in the c
libraries. Most of the changes fall into one of the following
categories:
- Added new glue routines for new resident library functions;
- Added new glue routines for amiga.lib functions, such as the
"Tags" functions;
- Deleted glue routines for resident library functions that
are obsolete or private.
For details, see the "lib/changes.lib" file.
3.4.3 New mf.lib functions
The following functions have been added to the Amiga FFP math
libraries (mf.lib, etc):
atan2
frexp
ldexp
3.4.4 Changes to ldexp()
ldexp() was changed in all math libraries to return 0 on underflow
instead of -HUGEVAL.
page 10
Aztec C/Amiga, v5.2a 11/1/91
3.4.5 The TZ environment variable
The manual's description of the gmtime() function does not report
that gmtime() makes use of an environment variable named TZ. This
variable has the following form:
mset TZ=EST5EDT
where
EST is the normal code for the time zone;
5 is the offset of the time zone from GMT;
EDT is the code for the time zone during daylight savings
time.
3.4.6 Changes to segload()
The segload() function was changed to report the result of a segment
load. It returns 1 if the load was successful and 0 if not.
The .segload() function that is called to automatically load a
segment was changed to display a recoverable alert if a load fails.
3.4.7 Changes to scdir()
The scdir() function was changed. When passed a NULL argument, it
resets its internal state. This allows scanning to change from one
pattern to another before all files that match a pattern have been
reported.
3.4.8 Changes to format()
The format() function was changed. Its calling sequence is now:
int format(int (*func)(), char *fmt, ...)
where "..." are the arguments that are to be accessed during the
scanning of the format string, instead of a va_list pointer to the
arguments. This change makes format() compatible with the v3.6a
format(), and with the format() that is provided with the Aztec
package for other 68k systems.
3.4.9 New _format() function
A new function, _format(), has been added. It has the following
calling sequence:
int _format(FILE *fp, char *fmt, va_list varg);
It's like format(), except fp points to the stream to which characters
are to be written, and varg points to a vararg list of the arguments
to be accessed during the scanning of the format string.
3.4.10 Changes to the low-level I/O functions
In order to allow you to give your own routines that match those of
Aztec unbuffered I/O routines, the following changes have been made to
c library routines:
page 11
Aztec C/Amiga, v5.2a 11/1/91
- The names of all the unbuffered I/O routines in the c libraries
(c.lib, etc) have been changed by prepending them with an
underscore;
- The standard I/O routines have been changed to call the
unbuffered I/O routines using their new names;
- New functions have been added to the c libraries that have the
same names as the original unbuffered I/O routines, and that
simply call the new unbuffered I/O routines.
3.5 Include file changes
3.5.1 Commodore's v2.04 and v1.3 include files
When installing Aztec C on a hard disk, the installation program
installs the Aztec v5.2 include files and Commodore's v2.04 include
files. In this case, the file functions.h defines prototypes and
amicall pragmas for all of Commodore's v2.04 functions. Programs
created using these functions will run on the v1.3 Amiga OS, if they
don't call any v2.0-specific functions. If you want to create programs
that you can be sure don't use any v2.0-specific functions, just
include func1_3.h instead of functions.h, since func1_3.h contains
prototypes and pragmas for just the v1.3 Commodore functions; you
don't have to use any other v1.3 Commodore include files, because the
structures, defines, and so on that are in the v2.04 include files are
compatible with those in the v1.3 Commodore include files.
When installing Aztec C on a floppy disk, the installation program
installs the Aztec v5.2 include files and Commodore's v1.3 include
files. The only reason for using the v1.3 include files instead of the
v2.04 was that the v2.04 include files took up too much of the floppy
disk's limited disk space.
3.5.2 Stripping out include file comments
There are a couple of ways to speed up the compiler's processing of
include files. One is to precompile the include files, using the
compiler's -ho and hi options. These options are described in the
Aztec manual.
Another way is to strip out the comments that are in the Amiga-
specific include files, using the stripc program. The calling sequence
for stripc has the form
stripc <infile> <outfile>
where <infile> is the name of the file that contains comments, and
<outfile> is the name of the file where you want the uncommented code
to be placed.
The script file 'make-strip' in the include directory will strip the
comments from all include files; it will place them in a subdirectory
named 'incl_strip' beneath the root Aztec directory.
3.6 The mapfd program
The 'mapfd' program generates pragmas and glue routines from the
Commodore-provided FD files that describe the calling sequences of
Commodore's resident library routines. You probably won't have a need
page 12
Aztec C/Amiga, v5.2a 11/1/91
to use mapfd, since we've already generated the pragma files and glue
routines for the resident library routines, but if you do need it,
it's here. mapfd has the following syntax:
mapfd [-g -l -p -e <extension> -o <outfile>] infile
where the parameters are as follows:
infile Name of the file containing the FD statements.
-o <outfile>
Write pragmas to <outfile>. By default, pragmas are
written to a file whose name is derived from the input
file name, by changing the extension to '.h';
-l Generate Lattice (SAS)-style pragmas;
-p Process 'private' functions;
-g Generate assembly language glue routines;
-e <ext>
Set extension of glue routine files to '.a68'
(defaults to '.a68');
-4 Generate pragmas for functions that take parameters in
register A4. By default, mapfd does not generate pragmas
for such functions, since usage of A4 can conflict with
the use of A4 by programs that use a small code or small
data memory model.
-5 Generate pragmas for functions that take parameters in
register A5. By default, mapfd does not generate pragmas
for such functions, since usage of A5 can conflict with a
program's use of A5 as a frame pointer.
The features of mapfd that are new in the 5.2 release are:
- mapfd wasn't previously provided on the distribution disks;
- The -4 and -5 options are new;
- This documentation is new.
4. Additional documentation
The following paragraphs describe features that are not described in
the manual.
4.1 Compiler
4.1.1 The -t compiler option
The -t option has been added to specify the maximum number of base
names defined in amicall/syscall #pragmas. The syntax of this option
is:
-t num_entries
where num_entries is the maximum number of base names entries allowed.
The compiler will give an error message if the number of base names
encountered in the program exceeds the number specified with -t (or
the default value if -t is not used). The default value is 50.
page 13
Aztec C/Amiga, v5.2a 11/1/91
4.1.2 C++ style comments
C++ style comments are now supported. These comments consist of two
forward slashes '//', and the comment is considered to go to the end
of the current line (that is, to the newline at the end of the line).
For example:
main ()
{
printf ("MS = %d\n", msval); // report value of MS
printf ("HA = %d\n", haval); // report value of HA
}
4.1.3 Register A6 usage and the -R6 compiler option
The compiler by default now only uses register A6 for
amicall/syscall #pragmas. This usually results in better code
generation, since A6 doesn't need to be continually pushed and popped
when #pragma calls are done. In this default mode the compiler never
saves the A6 register.
A new option -r6 has been added to the compiler, which allows the
compiler to use A6 as register variables. A6 is also always guaranteed
to be preserved. This option should be used if you are generating code
which needs A6 to be preserved. Also, if your code makes few #pragma
calls this option may improve code generation.
When a function returns, A6 always has the value it had on entry to
the function.
4.1.4 The -MR compiler option
The -mr option forces the compiler to use more registers as
temporary registers (which in turn reduces the number of registers
available for register variables). This option should only be used to
work around an "Expression too complex" error message.
4.2 Assembler
4.2.1 movem optimizations
The assembler optimizes out 0-register movem operations.
4.2.2 The -W assembler option
A -w switch has been added to the assembler, which turns on
optimization of 1 register movem's into move instructions.
4.3 SDB
4.3.1 The -S option
SDB no longer requires the use of the -s option for programs with
source in multiple directories. It will instead attempt to use the
path information used to compile the source code. i.e. if the source
was compiled as /front/foobar.c, then SDB will look for the file
'foobar.c' in the /front directory. This behavior may be overridden by
defining explicit search directories using the -s option.
page 14
Aztec C/Amiga, v5.2a 11/1/91
4.3.2 SDB and SDBF
There are now two versions of SDB - SDB and SDBF. The two programs
are identical except in the handling of floating point. SDB is
designed for use with code compiled for use with the m.lib (MANX
IEEE), ma.lib (AMIGA IEEE), or m8.lib (68881 coprocessor) libraries.
SDBF should be used with programs compiled with mf.lib (Motorola Fast
Floating Point, FPP).
4.4 Environment Variables
The compiler, assembler, and linker now use the standard Amiga-DOS
environment ENV: instead of the proprietary Manx environment that was
previously used by manx tools. This change was done primarily to
improve compatability with v2.0 of AmigaDOS.
Aztec tools now look in a subdirectory beneath ENV: called
'MANX' for the individual environment variables. The new utility
'mset' should be used to create environment variables for use with
Aztec C, since mset automatically creates the 'MANX' directory if it
does not already exist. mset uses syntax is identical to the that of
the old 'set' command.
The setenv() and getenv() library calls now use ENV: as well. To
access standard environment variables, simply use:
status = setenv ("VARNAME", "NEW_VALUE");
and
val = getenv ("VARNAME");
Note that setenv() now returns non-zero if it fails, and zero if
successful. No value was returned by setenv() under 5.0a. To set and
access an environment variable for use by Aztec tools, you should use:
status = setenv ("MANX/VARNAME", "NEW_VALUE");
and
val = getenv ("MANX/VARNAME");
4.5 Libraries
Four new functions have been added to the library: stricmp(),
strnicmp(), strlwr(), and strupr().
4.5.1 The stricmp() function
int stricmp(const char *s1, const char *s2);
This function is identical to the strcmp() function, with the
exception that the comparison between the two strings is case
insensitive (i.e., "foobar" and "FooBar" are considered equivalent to
stricmp()).
4.5.2 The strnicmp() function
int strnicmp(const char *s1, const char *s2, size_t n);
page 15
Aztec C/Amiga, v5.2a 11/1/91
This function is identical to the strncmp() function, with the
exception that the comparison between the two strings is case
insensitive (i.e., "foobar" and "FooBar" are considered equivalent to
strnicmp().
4.5.3 The strlwr() function
char *strlwr (char *str);
This function converts the string pointed to by 'str' into all lower
case. All non alphabetic characters within the string are left as they
are. A pointer to the the converted string is returned by strlwr.
Note that the original string pointed to 'str' is destroyed by
strlwr().
4.5.4 The strupr() function
void strupr (char *str);
This function converts the string pointed to by 'str' into all upper
case. All non alphabetic characters within the string are not
affected. A pointer to the the converted string is returned by strlwr.
Note that the original string pointed to 'str' is destroyed by
strlwr().
4.6 Stack usage
The compiler requires a minimum of 8K of stack, especially if you
are generating/using precompiled header files. If a smaller stack is
used the compiler may guru (if you're lucky).
4.7 Supported #pragma syntaxes
An undocumented feature in 5.0 is support for the Lattice format for
in-line calling of amiga resident library functions, through
#pragma's. This allows you to use most #include files designed for
Lattice without modification.
4.8 ARexx Support
We do not at this time provide ARexx scripts for use with the
compiler's QuikFix option.
4.9 ARP compatibility
ARP users should note that the Arp set command will no longer work
with Aztec tools due to the fact that 5.0b now uses the AmigaDOS
environment. Manx 5.x compatable ARP bindings are included in the arp
directory (these are unofficial bindings, but seem to work well 8-),
in addition to the official ARP files.
4.10 Version 3.6a Compatibility notes
Several important things have changed between the 3.6a and 5.0d
versions. The most important differences are:
page 16
Aztec C/Amiga, v5.2a 11/1/91
4.10.1 Compiler options
Almost all compiler options have changed in version 5.0, which means
you will eventually have to translate your script and makefiles to use
the new options. However, we have provided a 'compatability-switch'
which will allow you to use the old options. This switch is '-3'.
Any 3.6a compiler options you have MUST come after a '-3' option for
them to be recognized properly. For example, the compile line:
cc -n +c +d test.c
Should be changed to:
cc -3 -n +c +d test.c
To avoid having to change all your makefiles, you may optionally set
the '-3' option using the CCOPTS environment variable. The command:
set CCOPTS=-3
will in effect set the default option parsing to 3.6a syntax. Note
that if you do use the -3 option, any 5.0d options must be prefixed
with '-5'. The '-5' and '-3' options may be mixed freely on the
command line. See the compiler reference documentation for details.
4.10.2 ANSI Compiler changes
The way the compiler handles expressions and other language rules
has changed somewhat from version 3.6a in order to be compatible with
the proposed ANSI standard. These changes should not affect most
programs, but will change the behavior of some user code. For maximum
source compatability with 3.6a, you should use the '-k' compiler
option. This forces the compiler to evaluate C expresions using
Kernighan & Ritchie rules rather than ANSI rules. The -k option is
recognized both under -5 and -3. To achive maximum 3.6a
compatability, it may be desirable to set CCOPTS as follows:
set "CCOPTS=-3 -k"
The compiler will give the error "can't take address of
register class" for the following type of code:
funky_func ()
{
register char array[30];
call (array);
}
Under previous versions of the compiler, the 'register' modifier
would simply be ignored. However, ANSI requires that taking the
address of a 'register' class object is always in error, even if the
object actually is placed in addressable memory. For arrays this
effectively means that you cannot access any elements within the
array, or use the array in any useful manner at all.
The fix for this is to remove the 'register' modifier from the array
declaration.
page 17
Aztec C/Amiga, v5.2a 11/1/91
4.10.3 ANSI library/header changes
Due to space limitations, we are not able to provide fully 3.6a
compatabile libraries along with the new ANSI compatable libraries.
This should not be a problem with most programs since the new
libraries are mostly the same as those under 3.6a. However, some code
will still break. Things to look out for include:
- agetc() and aputc() are gone. They may be defined as:
#define agetc() putc()
#define aputc(x,file) putc (x,file)
- The size returned by the sizeof operator is now equivalent to the
new ANSI type 'size_t', as well as the result of pointer
subtraction. Since 'size_t' is typedef'd to be of type 'unsigned
long', and 3.6a used 'unsigned int' for these operations, code
which depends on this will break. Notable functions which require
arguments of type 'size_t' include malloc() and fread(). If you
are using 16-bit integers, you MUST cast the values passed to
malloc() and similar functions to type 'size_t' for the call to
work. For example, to allocate 50 bytes you should say:
cptr = malloc ((size_t)50);
The best way to avoid problems with these is to always include
the appropriate header files. The most commonly used ones are
stdio.h for standard I/O, string.h for string operations, and
stdlib.h for miscellaneous operations such as memory allocation.
- The module 'heapmem.o' is no longer included with the package.
All heap mangement, including the realloc() function, is
contained within the normal c.lib library.
4.10.4 Calling Amiga functions
By default, if you #include the file functions.h, the compiler will
generate inline calls to Amiga resident library routines, rather than
calling an assembly language stub. This method is generally smaller
and faster than using stub routines. If for some reason you wish to
use the old stubs and want to compile with functions.h, you should
fist define the pre-processor macro __NO_PRAGMAS before you include
functions.h. This should be done like this:
#define __NO_PRAGMAS
#include <functions.h>
If you are not compiling with functions.h, then you don't need to do
anything - the linker will automatically pull in the appropriate stub
routines in from the standard C library.
4.10.5 Old object code/libraries
Version 5.0d is NOT object code or library compatable with
version 3.6a of Aztec C or below. The reason for this is that the
default register usage conventions of the compiler have been changed
from that of previous versions. This means that all source code must
be re-compiled for use with 5.0d. In addition, assembly code called by
C must be changed to reflect the new register conventions. 5.0d is
object-compatible with previous 5.0 versions however (5.0a, 5.0b, and
5.0c).
page 18
Aztec C/Amiga, v5.2a 11/1/91
4.10.6 Default integer size
The default integer size has been changed from 16-bits to 32-bits.
This was done to make it easier to port code from other systems, as
well as to minimize crashing in 'beginner' code. Because of this, the
library naming conventions have also changed. The libraries now map in
this fashion:
3.6a | 5.0d
---------------------
c.lib | c16.lib small code/small data 16-bit ints
cl.lib | cl16.lib large code/large data 16-bit ints
cl32.lib | cl.lib large code/large data 32-bit ints
c32.lib | c.lib small code/small data 32-bit ints
4.10.7 Default math libraries
A new math library, based on Manx IEEE floating point, has been
added. This library is the most accurate of all the libraries, and is
now set to be the default. The libraries from 3.6a to 5.0b map in
this fashion with regards to naming conventions:
3.6a | 5.0b
---------------------
--- | m.lib Manx IEEE floating point
ma.lib | ma.lib Amiga IEEE floating point
m.lib | mf.lib Motorola FFP floating point
m8.lib | m8.lib 68881 floating point
4.10.8 Bitfields
Bitfields may only be of type 'int' or 'unsigned int' in version
5.0b. Previous versions also allowed bitfields to be of type 'short'
and 'unsigned short'.
4.10.9 functions.h
The declarations in the functions.h header file now include ANSI
prototyping of Amiga function arguments, in addition to declaring
function return types. This can cause a large number of ptr/ptr and
ptr/int conversion warnings to be generated in certain types of
programs. If you receive a large number of these types of warnings in
code which includes functions.h and do not wish to make the necessary
corrections, you will have to remove the inclusion of functions.h and
declare function return types yourself. The majority of problems will
most likely be with messages and I/O requests. In most cases warnings
in these areas can be cured with a simple cast in the function call.
For example:
AbortIO ((struct IORequest *)req);
ReplyMsg ((struct Message *)msg);
Simple casts of this type should remove 90%-95% of warnings due to
prototypes in typical code.
page 19